package main

import (
	"fmt"
	"gopkg.in/fatih/set.v0"
)

func main() {
	a := set.New(set.ThreadSafe)
	for i := 0; i < 1000010; i++ {
		a.Add(i)
	}
	fmt.Println("1")
	b := set.New(set.ThreadSafe)
	for i := 1000000; i < 2000000; i++ {
		b.Add(i)
	}
	fmt.Println("2")
	// 并集
	//unionSet := set.Union(a, b)
	//fmt.Printf("并集:%v\n", unionSet)

	// 交集
	intersectionSet := set.Intersection(a, b)
	fmt.Printf("交集:%v\n", intersectionSet)

	////差集
	//diffS1S2 := set.Difference(a, b)
	//fmt.Printf("差集(属a不属b):%v\n", diffS1S2)
	//
	//diffS2S1 := set.Difference(b, a)
	//fmt.Printf("差集(属b不属a):%v\n", diffS2S1)
}
